package com.business.sys.service.impl;


import java.util.List;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.plugins.Page;
import com.business.common.utils.PageUtils;
import com.business.common.dto.R;

import com.business.sys.entity.DictionaryType;
import com.business.sys.mapper.DictionaryTypeMapper;
import com.business.sys.service.DictionaryTypeService;



/**
 * 字典类型表:业务接口实现类
 * @author chenjiehong
 * @date 2019-11-29 14:24:28
 * @since 1.0
 */
@Service
@Transactional
public class DictionaryTypeServiceImpl implements DictionaryTypeService {
    
    @Autowired
    private DictionaryTypeMapper dictionaryTypeMapper;
    
    @Override
    public DictionaryType add(DictionaryType dictionaryType){
        return dictionaryType;
    }
    
    @Override
    public  DictionaryType query(Integer id){
        DictionaryType dictionaryType = dictionaryTypeMapper.selectById(id);
        return dictionaryType;
    }
    
    @Override
    public PageUtils queryPage(Page<DictionaryType> page, DictionaryType dictionaryType){
        Wrapper<DictionaryType> wrapper = new EntityWrapper<>(dictionaryType);
        List<DictionaryType> result = dictionaryTypeMapper.selectPage(page,wrapper);
        PageUtils pageUtils = new PageUtils(result, page.getTotal());
        return pageUtils;
    }
    
    
    @Override
    public Integer update(DictionaryType dictionaryType){

        return  dictionaryTypeMapper.updateById(dictionaryType);
    }
    
    @Override
    public Integer delete(Integer id){
        return dictionaryTypeMapper.deleteById(id);
    }
    
}